size = int(input("请输入三角形的长度\n"))
print("1. 左下角三角形:\n")
i = 0
while i < size:
    print('* ' * (i + 1))
    i += 1

print("2. 右下角三角形:\n")
i = 0
while i < size:
    print('  ' * (size - i - 1) + '* ' * (i + 1))
    i += 1

print("3. 左上角三角形:\n")
i = size
while i > 0:
    print('* ' * i)
    i -= 1

print("4. 右上角三角形:\n")
i = size
while i > 0:
    print('  ' * (size - i) + '* ' * i)
    i -= 1
